<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ page isELIgnored="false" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   <link rel="stylesheet" href="<s:url value="/resources"/>/css/common.css" type="text/css" />
<link rel="stylesheet" href="<s:url value="/resources"/>/css/innerstyle.css" type="text/css" />
<link rel="stylesheet" type="text/css" media="screen" href="<s:url value="/resources"/>/css/ui-lightness/jquery-ui-1.8.23.custom.css" />
<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="<s:url value="/resources"/>/js/jquery-ui-1.8.23.custom.min.js"></script> 



<SCRIPT language=javascript type=text/javascript>

     function beforeCommit()
   {
     
     if(document.getElementById("tbPassWord").value=="")
     {
       alert("密码不能为空!");
       document.getElementById("tbPassWord").focus();
       return false;
     }
     if(document.getElementById("tbNewPassWord").value=="")
     {
       alert("请输入新密码!");
       document.getElementById("tbNewPassWord").focus();
       return false;
     }
      if(document.getElementById("tbNewPassWord1").value=="")
     {
       alert("请再次输入新密码!");      
       document.getElementById("tbNewPassWord1").focus();
       return false;
     }
     
     if(document.getElementById("tbNewPassWord").value!=document.getElementById("tbNewPassWord1").value)
     {
       alert("两次密码不一致!");      
       document.getElementById("tbNewPassWord").focus();
       return false;
     }
     var formdata = $("#form1").serialize();  
     var url = "updatePasswordByUserid?"+formdata;		    
		    $.post(url, function(data) {
               
		        alert(eval('(' + data + ')').msg);
            });
	
   }
   function ol() {
   	$("#btn1").button();
   }
    </SCRIPT>
  </head>
  
  <BODY  onLoad="ol()" >
 
<FORM id="form1" method="post" name="form1"   >
 <div    id="best1">
   <table  border="0" class="datalist"  >
     <tr class="altrow">
       <td width="40%" align="right">旧密码:</td>
       <td > <INPUT id="tbPassWord" class="txtStyle" name="password" type="password"> </td>
     </tr>
     <tr>
       <td align="right">新密码:</td>
       <td>  <INPUT id="tbNewPassWord" class="txtStyle" name="newPassWord" type="password"> </td>
     </tr>
     <tr class="altrow">
       <td align="right">再次输入新密码:</td>
       <td><INPUT id="tbNewPassWord1" class="txtStyle" name="password1" type="password"></td>
     </tr>
     <tr><td align="right"></td>
       <td  align="left" ><INPUT id="btn1"  type="button" value="提交" onClick="beforeCommit()" > </td>
      </tr>
  
   </table>
 </div>
</FORM></BODY>
</html>
